package com.shengde.jinwawaforleader.model.myJob.instance_message;

import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.shengde.jinwawaforleader.R;
import com.shengde.jinwawaforleader.views.photoview.PhotoView;

/**
 * 点击看大图(即时通许联系人头像,个人中心头像 等等)
 * Created by Administrator on 2016/11/21 0021.
 */
public class ObserveBigPicActivity extends com.shengde.jinwawaforleader.base.BaseActivity {
	private static final String TAG = "ObserveBigPicActivity";
	private PhotoView iv_big_pic;
	private TextView tv_title;
	private TextView tv_back;
	private String big_img_url;

	@Override
	public void onRoot(Bundle savedInstanceState) {
		setContentView(R.layout.observer_big_pic_activity);
	}

	@Override
	public void initView() {
		tv_back = (TextView) findViewById(R.id.tv_back);
		tv_title = (TextView) findViewById(R.id.tv_title);
		iv_big_pic = (PhotoView) findViewById(R.id.iv_big_pic);
	}

	@Override
	public void initData() {
		tv_title.setText(getString(R.string.picture));
		big_img_url = getIntent().getStringExtra("big_img_url");
		Log.i(TAG, "initData: big_url" + big_img_url);

		Glide.with(this).load(big_img_url).error(R.drawable.em_default_avatar)
				.into(iv_big_pic);
	}

	@Override
	public void initListener() {
		tv_back.setOnClickListener(this);
	}

	@Override
	public void onWidgetClick(View view) {
		switch (view.getId()) {
			case R.id.tv_back:
				finish();
				break;
		}
	}
}
